Facebook is becoming very popular and bringing more advanced options every month and attracting the members.  I like mindjolt facebook application and i enjoyed almost all the games. Tower Stacker is one of game i like the most from mindjolt. That game is a simple game and a very interesting game too. So, I planned to create the same game in AS3. I know that game needs some math functions like "atan2" to swing the holder.
Objective of this game:
  1. Holder should pick a new tower ball and start to swing
  2. Holder should place the ball on the selected location
  3. Again a new ball will be generated and started swing. If the recent ball placed on the line of the previous ball, the ball is on the stack or it will fall down from the stack.
  4. The score is based on the exact location of the recent ball with the last ball placed on the stack.
To swing the holder every time right after picking the new ball, we need pythagoras theorem, atan2(x1-x2)*degrees/PI, this will swing the holder one time, to make it oscillate I have to detect two x positions for start and end and need decrease/increase the speed of the oscillation based on the direction like,

rope_mc.rotation=Math.atan2(rope_mc.x-xSpeed,ySpeed)*90/Math.PI;

to make it swing, I am multiplying the speed with -1 on each swing like,

if (holderStatus=="swing") {
                if (xSpeed>=540||xSpeed<=50) {
                    speed*=-1;
                }
                xSpeed+=speed;
}

Now I should drop the ball on each mouse click, and placed the ball on stack based on some conditions. I used a separate movieclip to have the base of the stack and to add the balls each time on mouse click. From the second ball, each ball will be placed on the stack only if it is hit the previous one in a least best position. The score will be calculated based on the position it placed on the stack.
You like it? Let me come with some other game soon.
 
As many flash developer do, I started implementing a small game in flash AS2 to step into Game Development. The game Tic Tac Toe, I have played this game many times in my mobile whenever I traveled a long distance. It's been always easy to play, win and lose sometimes. But when I was thinking about the logic behind this game, I decided to go with simple Matrix combination. I am always a matrix hater because it gives me indefinite loops sometime and crash my flash and make my system slow. But I had no choice for this game and I planned a matrix combination like the following one. A simple box matrix.

00                 01               02
10                 11                12
20                 21                22

I have separated my class files into Game.as, Logic.as and Object.as. By their names, they do separate jobs in this game. Game class will be generating the game platform and link the Object class and Logic class right after creating the game platform. Logic class will create the logic and then initiate the game process. Object classes will return games objects that are used and loaded into game platform at run-time. Lets see the game before we get into it.
The Logic for this game is working in two different way. One way is to act like another player (called PC man) and another way is to keep track of the user's (You) movement and check the game win scenarios. When Logic work as a PC Man, it will keep listening to the user movement first to check if there is any wining point for the user in the next move, if there is any then it will lock that next point otherwise it will pick one random places and place PC man coin there.

How logic works and checks:

If any one of the box is clicked, I am placing the user name of who clicked in that box. So, the user name is key to check all the boxes for win. So, I will check the horizontal boxes, vertical boxes and two side diagonal boxes for their user names. If all the three names are same, its should say someone has won the game already. Look into the source file for more details. I am working some other facebook flash game too. I will post it here soon.
tic_tac_toe.zip
File Size: 1191 kb
File Type: zip
Download File